<template>
	<view class="content">
		<cu-custom bgColor="bg-gradual-blue" :isBack="false">
			<block slot="backText">返回</block>
			<block slot="content">首页</block>
		</cu-custom>
		<!-- 轮播 -->
		<swiper class="screen-swiper" :class="dotStyle?'square-dot':'round-dot'" :indicator-dots="true" :circular="true"
		 :autoplay="true" interval="5000" duration="500">
			<swiper-item v-for="(item,index) in swiperList" :key="index">
				<image :src="item.url" mode="aspectFill" v-if="item.type=='image'"></image>
				<video :src="item.url" autoplay loop muted :show-play-btn="false" :controls="false" objectFit="cover" v-if="item.type=='video'"></video>
			</swiper-item>
		</swiper>
		<!-- 宫格 -->
		<view class="grid margin-bottom text-center">
			<view class="padding">
				<image class="img_ge" src="../../static/image/notice.png" mode="widthFix"></image>
				<text class="txt">通知</text>
			</view>
			<view class="padding">
				<image class="img_ge" src="../../static/image/tip.png" mode="widthFix"></image>
				<text class="txt">提示</text>
			</view>
			<view class="padding">
				<image class="img_ge" src="../../static/image/qs.png" mode="widthFix"></image>
				<text class="txt">问卷</text>
			</view>
			<view class="padding">
				<image class="img_ge" src="../../static/image/add.png" mode="widthFix"></image>
				<text class="txt">添加</text>
			</view>
			<view class="padding">
				<image class="img_ge" src="../../static/image/share.png" mode="widthFix"></image>
				<text class="txt">分享</text>
			</view>
			<view class="padding">
				<image class="img_ge" src="../../static/image/modify.png" mode="widthFix"></image>
				<text class="txt">编辑</text>
			</view>
			<view class="padding">
				<image class="img_ge" src="../../static/image/component_cur.png" mode="widthFix"></image>
				<text class="txt">归档</text>
			</view>
		</view>

		<!-- 标题 -->
		<view class="cu-bar bg-white solid-bottom margin-top">
			<view class="action">
				<text class="cuIcon-title text-blue">日志</text>
			</view>
		</view>

		<view class="cu-bar justify-center bg-white margin-top">
			<view class="action">
				<text class="cuIcon-title text-bold text-green" @click="toWelcome()">日志</text>
			</view>
		</view>

		<button type="primary" @click="share">分享</button>
	</view>
</template>


var jweixin = require('./jweixin')
<script>
	export default {
		data() {
			return {
				title: 'Hello',
				swiperList: [{
					id: 0,
					type: 'image',
					url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84000.jpg'
				}, {
					id: 1,
					type: 'image',
					url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big37006.jpg',
				}, {
					id: 2,
					type: 'image',
					url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big39000.jpg'
				}, {
					id: 3,
					type: 'image',
					url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg'
				}, {
					id: 4,
					type: 'image',
					url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big25011.jpg'
				}, {
					id: 5,
					type: 'image',
					url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big21016.jpg'
				}, {
					id: 6,
					type: 'image',
					url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg'
				}],
				dotStyle: false,
				towerStart: 0,
				direction: '',
				avatar: ['https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg',
					'https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg',
					'https://ossweb-img.qq.com/images/lol/web201310/skin/big25002.jpg',
					'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg'
				],

			}
		},
		onLoad() {

		},
		methods: {
			toWelcome() {
				window.location.href = './welcome.vue'
			},
			share: function() {
				uni.share({
					provider: "weixin",
					scene: "WXSceneSession",
					type: 1,
					summary: "我正在使用HBuilderX开发uni-app，赶紧跟我一起来体验！",
					herf:"http:www.baidu.com",
					success: function(res) {
						console.log("success:" + JSON.stringify(res));
					},
					fail: function(err) {
						console.log("fail:" + JSON.stringify(err));
					}
				});
			}
		},
		onShareAppMessage: function() {
			return {
				title: "分享测试",
				path: 'pages/index/index'
			}
		},
		//分享到微信朋友圈
		shareFriendcricle: function() {
			uni.share({
				provider: "weixin",
				scene: "WXSenceTimeline",
				type: 0,
				href: "http:*******************",
				title: "你笑起来真好看",
				summary: "唐艺昕，没有水的地方叫沙漠，没有你的地方，你知道叫什么吗？不知道。叫寂寞。",
				imageUrl: "http:*******************",
				success: function(res) {
					console.log("success:" + JSON.stringify(res));
				},
				fail: function(err) {
					console.log("fail:" + JSON.stringify(err));
				}
			});
		},
	}
</script>

<style>
	.padding {
		padding: 5px;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}

	.tools.v_view {
		text-align: center;
		overflow: hidden;
		padding: 20upx 5%;
	}

	.img_ge {
		width: 100upx;
		height: 100upx;
	}

	.txt {
		display: block;
		ont-size: 14px;
	}
</style>
